﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterAdmin.master" AutoEventWireup="true" CodeBehind="DataCustomer.aspx.cs" Inherits="UdrinkWater_Project.Admin.DataCustomer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" 
        HeaderText="ยืนยันการสมัครสมาชิก" Width="100%">
        <HeaderStyle Font-Size="Medium" HorizontalAlign="Left" />
        <PanelCollection>
            <dx:PanelContent runat="server" SupportsDisabledAttribute="True">
                <dx:ASPxButton ID="bt_ConfirmCustomer" runat="server"
                    Text="ยืนยันการสมัครสมาชิก" Width="139px" 
                    OnClick="bt_ConfirmCustomer_Click">
                    <ClientSideEvents Click="function(s, e) {
	e.processOnServer = confirm('ยืนยันการสมัครสมาชิกของลูกค้า');
}" />
                </dx:ASPxButton>
                <dx:ASPxGridView ID="GV_CustomerConfirm" runat="server" 
                    AutoGenerateColumns="False" DataSourceID="SqlData_Customer" 
                    KeyFieldName="ID_Card" Width="100%" 
                    OnRowCommand="GV_CustomerConfirm_RowCommand">
                    <Columns>
                        <dx:GridViewCommandColumn Caption="ยืนยันการสมัคร" 
                            ShowInCustomizationForm="True" ShowSelectCheckbox="True" VisibleIndex="12" 
                            Width="50px">
                            <ClearFilterButton Visible="True">
                            </ClearFilterButton>
                            <HeaderStyle HorizontalAlign="Center" />
                        </dx:GridViewCommandColumn>
                        <dx:GridViewDataTextColumn FieldName="ID_Card" ReadOnly="True" 
                            ShowInCustomizationForm="True" VisibleIndex="0" Caption="รหัสสมาชิก">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="Prefix" ShowInCustomizationForm="True" 
                            VisibleIndex="1" Caption="คำนำหน้า">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="Firstname" ShowInCustomizationForm="True" 
                            VisibleIndex="2" Caption="ชื่อ" Width="100px">
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="Lastname" ShowInCustomizationForm="True" 
                            VisibleIndex="3" Caption="นามสกุล">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="Adress" ShowInCustomizationForm="True" 
                            VisibleIndex="4" Caption="ที่อยู่">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataComboBoxColumn FieldName="DISTRICT_ID" 
                            ShowInCustomizationForm="True" VisibleIndex="5" Caption="ตำบล">
                            <PropertiesComboBox DataSourceID="SqlData_District" TextField="DISTRICT_NAME" 
                                ValueField="DISTRICT_ID" ValueType="System.Int32">
                            </PropertiesComboBox>
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataComboBoxColumn>
                        <dx:GridViewDataComboBoxColumn FieldName="AMPHUR_ID" 
                            ShowInCustomizationForm="True" VisibleIndex="6" Caption="อำเภอ">
                            <PropertiesComboBox DataSourceID="SqlData_Aumphur" TextField="AMPHUR_NAME" 
                                ValueField="AMPHUR_ID" ValueType="System.Int32">
                            </PropertiesComboBox>
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataComboBoxColumn>
                        <dx:GridViewDataComboBoxColumn FieldName="PROVINCE_ID" 
                            ShowInCustomizationForm="True" VisibleIndex="7" Caption="จังหวัด">
                            <PropertiesComboBox DataSourceID="SqlData_Province" TextField="PROVINCE_NAME" 
                                ValueField="PROVINCE_ID" ValueType="System.Int32">
                            </PropertiesComboBox>
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataComboBoxColumn>
                        <dx:GridViewDataTextColumn FieldName="Phone" ShowInCustomizationForm="True" 
                            VisibleIndex="9" Caption="เบอร์โทรศัพท์">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn FieldName="Zipcode" ShowInCustomizationForm="True" 
                            VisibleIndex="8" Caption="รหัสไปรษณีย์">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataComboBoxColumn FieldName="Status" 
                            ShowInCustomizationForm="True" VisibleIndex="11" Width="100px" 
                            Caption="สถานะ">
                            <PropertiesComboBox DataSourceID="SqlData_Status" EnableFocusedStyle="False" 
                                TextField="Status_RegisterName" ValueField="Status_RegisterID" 
                                ValueType="System.Int32">
                            </PropertiesComboBox>
                        </dx:GridViewDataComboBoxColumn>
                        <dx:GridViewDataTextColumn FieldName="Pasword" ShowInCustomizationForm="True" 
                            Visible="False" VisibleIndex="10">
                            <Settings AllowAutoFilter="False" />
                        </dx:GridViewDataTextColumn>
                        <dx:GridViewDataTextColumn ShowInCustomizationForm="True" VisibleIndex="13">
                            <DataItemTemplate>
                                <asp:LinkButton ID="lb_Delete" runat="server" OnClientClick = " return confirm('ยืนยันการลบข้อมูล');" Font-Underline="False" CommandName="Cmd_Delete" CommandArgument='<%# Eval("ID_Card") %>'
                                    ForeColor="#80A70E">ลบข้อมูล</asp:LinkButton>
                            </DataItemTemplate>
                        </dx:GridViewDataTextColumn>
                    </Columns>
                    <Settings ShowFilterRow="True" />
                </dx:ASPxGridView>
                <asp:SqlDataSource ID="SqlData_Customer" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
                    SelectCommand="SELECT [ID_Card], [Prefix], [Firstname], [Lastname], [Adress], [DISTRICT_ID], [AMPHUR_ID], [PROVINCE_ID], [Phone], [Zipcode], [Status], [Pasword] FROM [TB_Customer]">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlData_Province" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
                    SelectCommand="SELECT * FROM [TB_Province]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlData_Aumphur" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
                    SelectCommand="SELECT * FROM [TB_Aumphur]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlData_District" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
                    SelectCommand="SELECT * FROM [TB_District]"></asp:SqlDataSource>
                <asp:SqlDataSource ID="SqlData_Status" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:DB_Udrink %>" 
                    SelectCommand="SELECT * FROM [TB_StatusRegister]"></asp:SqlDataSource>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
</asp:Content>
